package com.app.scale.bean;

import com.alibaba.fastjson.annotation.JSONField;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Index;
import org.greenrobot.greendao.annotation.Generated;

@Entity(indexes = {@Index(value = "cdno", unique = true)})

public class UserInfoBean extends BasisBean {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    @JSONField(serialize = false)
    public static UserInfoBean getAdminInfo(){
        UserInfoBean userInfoBean = new UserInfoBean();
        userInfoBean.setUno(LoginBean.getInstance().getUno());
        userInfoBean.setUname( LoginBean.getInstance().getUname());
        return userInfoBean;
    }

    @JSONField(name = "dept")
    private String dept;
    @JSONField(name = "job")
    private String job;
    @JSONField(name = "upwd")
    private String upwd;
    @JSONField(name = "usign")
    private String usign;
    @JSONField(name = "unum")
    private String unum;
    @JSONField(name = "cdno")
    private String cdno;

    @Generated(hash = 568017619)
    public UserInfoBean(String dept, String job, String upwd, String usign,
            String unum, String cdno) {
        this.dept = dept;
        this.job = job;
        this.upwd = upwd;
        this.usign = usign;
        this.unum = unum;
        this.cdno = cdno;
    }

    @Generated(hash = 1818808915)
    public UserInfoBean() {
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public String getJob() {
        return job;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    public String getUsign() {
        return usign;
    }

    public void setUsign(String usign) {
        this.usign = usign;
    }

    public String getUnum() {
        return unum;
    }

    public void setUnum(String unum) {
        this.unum = unum;
    }

    public String getCdno() {
        return cdno;
    }

    public void setCdno(String cdno) {
        this.cdno = cdno;
    }






    public String getUfsName(){
        String typeName = "";
        switch (getUfs()){
            case "2":
                typeName = "计重员";
                break;
            case "3":
                typeName = "计价员";
                break;
            case "4":
                typeName = "管理员";
                break;
        }
        return typeName;
    }
}
